package com.springcloud.util.model;

import lombok.Data;
import org.apache.commons.lang3.StringUtils;

/**
 * @Description: TODO
 * @Create by: 123
 * @Date: 2021/11/22 16:57
 */

@Data
public class BoolFeature {
    private boolean feature;

    public BoolFeature(String feature, boolean defaultValue) {
        if (StringUtils.isNotBlank(feature)) {
            switch (feature) {
                case "true":
                    this.feature = true;
                    break;
                default:
                    this.feature = false;
            }
        } else {
            this.feature = defaultValue;
        }
    }
}
